Tab question.

Hello All,

It is been a while since I have done some UI DXLs. I am trying to add a tab and add some checkboxes to it after the dialog is realized. Does anyone know what I am missing here? I don;t see the checkboxes in "new Tab" which I inserted.

code
{
DB box = create "Test"
DBE dbeKC

string sKC[] = {"1.0", "2.0", "3.0"}
string items[] = {"A", "B", "C"}
DBE theTab

void tabSelected1(DBE theTab)
{

}

void tabSelected(DBE theTab)
{
int i = 0, iNumberTabs = 0
for(i=0;i<1;i++)
{
iNumberTabs = noElems(theTab)
insert(theTab,iNumberTabs ,"New Tab")
}

dbeKC = verticalCheckBox(box, " ", sKC, 0)
dbeKC -> "top" -> "inside" -> theTab
dbeKC -> "left" -> "inside" -> theTab
dbeKC -> "right" -> "inside" -> theTab
dbeKC -> "bottom" -> "inside" -> theTab
show dbeKC
}

theTab = tab(box, items, 300, 400,tabSelected1)
theTab->"top"->"form"
theTab->"left"->"form"
theTab->"bottom"->"form"
theTab->"right"->"unattached"

realize box
tabSelected (theTab )
show box

}
Thanks
Jester
jester76 - Tue Mar 12 13:34:15 EDT 2013

Re: Tab question.
llandale - Tue Mar 12 14:33:57 EDT 2013

I don't think you can create new DBEs on a realized box. I did not know you could insert a new tab.

Seems to me you need to create the tab with all potential tab-stops and all their DBEs; then "delete" the ones you don't want seen initially. then dynamically you could "insert" these stops.

Your callback tabSelected1() needs to get the index of the selected TAB and display those DBEs in it, hiding all others. That is REALLY tricky.

Instead:you may want tabSelected1() to know which tab stops are currently "illegal" and disallow their selection (by selecting another stop, perhaps #0).

-Louie

Re: Tab question.
jester76 - Tue Mar 12 15:32:05 EDT 2013

llandale - Tue Mar 12 14:33:57 EDT 2013
I don't think you can create new DBEs on a realized box. I did not know you could insert a new tab.

Seems to me you need to create the tab with all potential tab-stops and all their DBEs; then "delete" the ones you don't want seen initially. then dynamically you could "insert" these stops.

Your callback tabSelected1() needs to get the index of the selected TAB and display those DBEs in it, hiding all others. That is REALLY tricky.

Instead:you may want tabSelected1() to know which tab stops are currently "illegal" and disallow their selection (by selecting another stop, perhaps #0).

-Louie

Thank you very much Louie. I will think of a different implementation.

Thanks
Jester

Re: Tab question.
Tony_Goodman - Mon Mar 18 11:25:29 EDT 2013

The following page on my website shows you how to implement tabs.

http://www.smartdxl.com/content/?p=404

All dialog elements must be declared and craeted before realizing the dialog.
And it is usually best to declare all DBE variables globally.

Hope this helps.

Tony Goodman, www.smartdxl.com